home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
UTILSTEM
/
TAME102.LZH
/
TAME.DOC
next >
Wrap
Text File
|
1988-10-06
|
17KB
|
350 lines
Tame Users Guide
Release 1.02
Copyright 1988, by David G. Thomas
Abstract
If you run in a multitasking environment such as Desqview, you may have noticed
that some programs seem to slow down the whole system, even though they seem to
be doing nothing except waiting for you to type something. When I first
encountered this type of program, I accepted it as part of the price that is
paid for multitasking. The Tame program proves that this is not the case. In
fact, the Tame program will significantly reduce the overhead of many programs,
without hindering their performance when they really are working. Tame is
designed to work with Desqview, but should work with any DOS based multitasking
environment.
Copyright
This program may be freely distributed. If you use Tame to speed up your
applications, please contribute $10 to the author. If you send $20 or more,
you will recieve the latest copy of the program, and also a printed manual. If
you have any questions or comments, I may be reached at the PowerSoft BBS,
404-928-9294. Contributions should be mailed to the following address.
PowerSoft
P.O. Box 956338
Duluth, GA 30136
Attn: David G. Thomas
Applications that definitely NEED Tame
The following applications will continually poll the keyboard, waiting for you
to press a key. Tame has been proven to significantly reduce the overhead on
all these applications. For each application listed here, there are probably
100 more that need Tame!
See appendix "A" for special options that may be desirable with these programs.
Agenda, by Lotus
Brief, by solution Systems
Kedit, by Mansfield Computing
Lucid 3D, bu PCSG
Lotus 123, by Lotus Development Corp.
Lotus Agenda, by Lotus Development Corp.
Lotus Manuscript, by Lotus Development Corp.
Microsoft editor, by Microsoft
Norton Commander, by Peter Norton Computing
PCBOARD, by Clark Development Company, Inc.
Sidetalk, by Lattice
ZCOMM, by Chuck Forsberg
Finding more applications that need Tame
Any program that uses CPU cycles looking for keyboard input needs Tame. The
best way to see if a program does this is to run a simple test. You should
test all your favorite programs that you spend time entering data with. This
includes programs such as word processors, spreadsheets, editors, and DOS
shells.
One way to see if a program needs tame is to use Tame to run the program, and
see what happens. You may evaluate whether or not Tame is effective by
looking at statistics generated with the Tame command, or you may use one of
the many standard CPU benchmarks to test its effectiveness.
To test a program with Tame, be sure you are in Desqview, and type the
following command line, where command_line is the command line you normally use
to run the program. Note that if you are not in Desqview, you must also use
the -K or -I option as described in the advanced usage section below.
TAME -T command_line
Work in the program for a little while, then exit normally. Upon exit, Tame
will display a summary of its activities. The displayed totals include the
number of "Desqview pauses" that were performed. If this number is zero, then
Tame is not needed with the application. With some extremely keyboard-hungry
programs, the number of Desqview pauses can number into the thousands.
A second, and more direct way to test the effectiveness of Tame is to run the
application without Tame, and simultaneously run a CPU benchmark, such as
Norton's System Information (SI) program. Then use Tame to run the program
and run the same benchmark. Be sure the application is idle, and waiting for
keyboard input when you run the benchmark program. If the benchmark indicates
that the CPU is faster with Tame, then you know it is helping. Also,
experiment with which program is in the foreground and which is in the
background. This experiment is necessary if you have set the Desqview
background task priority to a very low number. In any event, it is
informitive, since it indicates the amount of processing time that the
background can get while you are using that application.
Running Tame
To run Tame, simply type the TAME command, followed by a command line. For
example, the following command will start up Lotus 123.
TAME LOTUS
If you always want Tame to be used, you may create a batch file (possibly named
RUNLOTUS.BAT) as described in the DOS manual.
If you normally execute the program with the Desqview "Open Window" menu, you
will need to modify the definition of the window. To do this, use the "CP"
(for Change Program) option of the "Open Window" menu, and change the Program
to TAME and add what was previously the Program to the beginning of the command
line parameters.
If your program runs slower with Tame
In some cases, the program may initially run slower with Tame installed. This
may be corrected by specifying the -Max parameter (described below) to increase
the number of polls allowed before Tame tries to switch tasks. For example,
the following command line should be used to run Lotus Manuscript.
TAME -MAX:20 MS
Using Tame with other multitaskers
Tame may be used with multitasking environments other than Desqview, but may
not be quite as effective. Also, you must include a command line option that
indicates the method that Tame uses to give idle time to the other tasks. The
-Key method will be effective with programs that are polling the keyboard, and
no other devices. It may not be compatible with communications programs. The
-Idle option is compatible with most programs, but may not be effective,
depending upon the multi tasking software being used. In either case, run Tame
as normal, except include one of the options prior to the command. The
following command will run Lotus 123 in a non-Desqview environment.
TAME -T -K LOTUS
Advanced usage
Try the TAMEPATH and TAMESMAL versions of the program. They will use less
memory, but they must run a .EXE or .COM file directly, and the full pathname
of the program file must be specified. This situation is tolerable when used
in a batch file.
Tame is designed to run with DOS shells, as well as normal applications. If
you use a DOS shell, such as the Norton Commander, that needs tame, you may use
Tame to execute the shell. By default, Tame will also be in effect for all
programs that are run with the shell. If you run your editor and other
programs with a batch file that forces Tame to be used, you will normally
invoke a second copy of Tame that may not be needed. Tame provides an easy
method to prevent you from accidentally running a second copy of Tame when you
are in the shell. To do this, include the following two lines in your
AUTOEXEC.BAT file.
SET TAME=TAME
SET TAMEPATH=TAMEPATH
If you desire, you may also include any Tame options that are desired. For
example, the following lines will print a totals summary upon exit.
SET TAME=TAME -T
SET TAMEPATH=TAMEPATH -T
Now, in the batch file that invokes your program, use the TAME variable as
follows. When run from the DOS shell, the command line will be run without
Tame, as long as the DOS shell was invoked using Tame.
%tame% command_line
Tame works by detecting when a program is continually polling the keyboard, and
does its best to allow the multi tasking software to switch to another task.
It detects that a program is polling the keyboard after three successive
keyboard polls, without attempting writing to the screen or issuing any DOS
requests. When the application polls the keyboard a fourth consecutive time,
Tame tries to switch the task. This threshold may be increased or decreased
using the -MAX:nn option, where nn is the threshold.
Whenever Tame is running, all programs of that task are affected. If you use
Tame to run a DOS shell, and you run a program under the DOS shell, then that
program is also tamed. If this is not desired, then the depth of programs may
be adjusted by using the -CALLS:nn option, where nn is the number of program
levels Tame has control over. This option should be used with care, since
some programs call other .EXE files as a normal part of their execution.
Some applications will grab the timer interrupt that the PC will issue 18 times
per second. In many cases, this interrupt takes a lot of processing time, but
really provides very little utility. To avoid wasting processing time
servicing the timer interrupt, you may prevent the application from
controlling the timer interrupt by specifying the -NOTIMER option. In many
cases, the timer interrupt may be used to keep a clock running on the screen.
This clock may not be worth much to you when you consider the amount of
processing time it uses. For example, the following command line will run the
Brief editor, (as long as the auto-save feature of Brief is disabled), and
will gain a significant amount of processor time for background processes.
TAME -NOTIMER B
Some applications spend a lot of time polling the system clock, normally for
the purpose of an maintaining an on-screen clock while it is waiting for other
devices to have a character ready. The -TIME option instructs Tame to treat
the date and time query in a manner similar to the keyboard poll, and yield the
time slice after successive date or time queries. The following program runs
PCBOARD, which keeps an on-screen clock while waiting for the communications
port.
TAME -TIME PCBOARD
Files included
TAME.DOC This document file.
TAME.EXE General purpose Tame program.
TAMEPATH.EXE Works only when you specify full path of .EXE or .COM
program. It uses slightly less memory than TAME.EXE
because it does not load another copy of COMMAND.COM.
TAMESMAL.EXE Same as TAMEPATH except it has no text output
capabilities, and therefore uses less memory.
SOURCE.ARC Complete source code is included. The source is
compatible with Microsoft C version 5.1.
Tame Command Reference
Task switching options
The main purpose of Tame is to switch to another task when it detects that the
application is wasting time polling the keyboard. The following options
specifiy the method that Tame should use in order to switch tasks.
-DesqView The -DesqView option specifies that Tame should execute the
-DV Desqview Pause function to switch tasks. Since Tame will
automatically detect the use of Desqview, this option is not
normally required.
-Idle The -Idle option specifies that the idle interrupt is to be
-I invoked as a method to switch tasks. This interrupt is
designed to be called whenever the application is idle, and
waiting on a specific device, such as the keyboard. In fact,
all applications that poll the keyboard waiting for input
should use this interrupt. Unfortunately, few do, so Tame will
call the interrupt for them. Some multitasking environments
will detect the interrupt call, and switch tasks. Other
environments will ignore the interrupt completely.
Note: The idle interrupt is Interrupt 15h, where ax=9002h.
-Key The -Key option specifies that when the program polls the
-K keyboard, Tame should tell a white lie and say that a key has
been pressed. Most applications will immediately read the key
that Tame claimed was already pressed. Since it really was not
pressed, DOS will wait for a key to be pressed. Most
multitaskers use this wait for a key press as a queue to switch
tasks. The -Key option could be the most effective task
switching method in Tame, but it will not work with some
applications. Specifically, the -KEY option will not work with
any applications that poll devices other than the keyboard.
Fine tuning for an Application
-Calls:nn This option will limit the scope of Tame to nn program levels.
For example, if you run a program using tame, and specify Tame
effects only one level, programs that are called by the Tamed
program will not be affected by Tame. This is mainly available
for useing Tame to run a DOS shell or another program that
allows you to execute other DOS commands.
-Max:nn This option sets the number of consecutive keyboard polls that
are acceptable before Tame decides that the program is simply
polling while waiting for input.
-NOTIMER This option prevents the application from processing the timer
interrupt that is normally issued by the PC 18 times per
second. This option may disable some features of the program,
and should be used with caution.
-TIME This option instructs Tame to consider a request for the
current time to be similar to a keyboard poll. This works well
with programs that constantly update an on-screen clock. This
option has no effect when -KEY is specified.
Other options
-Poll This option will cause Tame to allow all keyboard poll requests
to really poll the keyboard, effectively disabling the effect
of Tame. This option is really only useful when combined with
the -Totals option, so that the number of keyboard calls with
and without Tame may be compared. This comparison is most
effective when one or more background tasks are actively
running.
-Totals After the program exits, a summary report is displayed. The
summary includes the number of task switches that were
initiated by Tame, and also the total number of keyboard calls
that the application made.
Appendix "A"
Recommended Tame parameters for Desqview
Most applications may be run with Tame without any special parameters.
However, for best results, certain command line parameters may be desirable for
some applications. The following table represents the benefits and effects of
recommended command line parameters for each program when run under Desqview.
You are free to add the -Totals option to any of these if a summary report is
desired. You may also use TAMEPATH or TAMESMAL in place of TAME as long as the
full path name of the program file is specified.
Application Recommended command line Results & Side effects
Program
Brief TAME B * 75% of the CPU overhead is
eliminated.
Brief TAME -NOTIMER B * Nearly all the CPU overhead is
eliminated.
* On screen clock is not
operational.
* Autosave feature will not
operate
Kedit TAME KEDIT * Nearly all of the CPU overhead
is eliminated.
Lotus 123 TAME LOTUS * Nearly all the CPU overhead is
eliminated.
Lotus Agenda TAME AGENDA * Nearly all the CPU overhead is
eliminated.
Lotus TAME -MAX:20 MS * Nearly all the CPU overhead is
Manuscript eliminated.
Lucid 3D TAME LUCID * Nearly all the CPU overhead is
eliminated.
Microsoft TAME M * Nearly all the CPU overhead is
Editor eliminated.
Norton TAME NCSMALL * Nearly all the CPU overhead is
Commander eliminated.
* Tame will also cover programs
that are run by the shell.
PCBOARD TAME -TIME PCBOARD * About half of the CPU overhead
is eliminated.
Sidetalk TAME ST /N * 75% of the CPU overhead is
eliminated.
* Do not use tame without the /N
parameter.
ZCOMM TAME ZCOMM * About 75% of the CPU overhead
is eliminated.